<!DOCTYPE html>
<html>
 <head>
  <title>js函数对象</title>
  <meta charset="utf-8">
 </head>

 <body>
  <script>
//    alert(window)
//	alert(this)
  //js类型检测
  var v1 = 10
  var v2 = 'string'
  console.log(typeof v1)
  console.log(typeof v2)

  var v11 = []
  var v12 = {}
  var v13 = /ab/ig
  console.log(v11 instanceof Array)
  console.log(v12 instanceof Object)
  console.log(v13 instanceof RegExp)

  //标记对象给GC销毁
  var persion = {
	name : 'Mr chen'
  }
  console.log( persion.name ) 
  persion = null//等待回收

  //基本包装类型 Boolean Number String 提供了内置的方法
  var str = 'hello world.'
  console.log( str.substring(6) )//world.

//Number静态属性
  console.log(Number.MAX_VALUE)
  console.log(Number.MIN_VALUE)
  var pi = 3.1415926
  console.log(pi.toString())
  console.log(pi.toFixed(2))//保留两位四舍五入



  </script>
 </body>
</html>
